package org.leyi.shop.common.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.leyi.shop.common.response.EnumResponse;

/**
 *
 * description:  TODO
 *<br> create 2024/5/4-23:46
 * @author  lenovo

 */
@EqualsAndHashCode(callSuper = false)
@Data
public class BusinessException extends RuntimeException{
    private int code;
    private String description;
    public BusinessException(EnumResponse EnumResponse)
    {
        super(EnumResponse.getMessage());
        this.code=EnumResponse.getCode();
        this.description=EnumResponse.getDescription();
    }
    public BusinessException(EnumResponse EnumResponse,String message,String description)
    {
        super(message);
        this.code=EnumResponse.getCode();
        this.description=description;
    }

    public BusinessException(EnumResponse enumResponse, String message) {
        this(enumResponse,message,"");
    }
}